<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Vue中的使用animate.css库</title>
  <link rel="stylesheet" href="../asset/css/animate.css">
  <script src="../asset/js/vue.js"></script>
  <style>
    /* @keyframes bounce-in {
      0% {
        transform: scale(0);
      }
      50% {
        transform: scale(1.5);
      }
      100% {
        transform: scale(1);
      }
    }

    .active {
      transform-origin: left center;
      animation: bounce-in 1s;
    }

    .active {
      transform-origin: left center;
      animation: bounce-in 1s reverse;
    } */
  </style>
</head>

<body>
  <div id="root">
    <!-- 使用animate.css库必须使用自定义的过渡类名 -->
    <transition name='fade' enter-active-class='animated swing' leave-active-class='animated shake'>
      <div v-if='show'>Hello World</div>
    </transition>
    <button @click='handleClick'>切换</button>
  </div>
  <script>
    let vm = new Vue({
      el: '#root',
      data: {
        show: true
      },
      methods: {
        handleClick() {
          this.show = !this.show
        }
      }
    })
  </script>
</body>

</html>